package com.chb.microservice.provider.hystrix;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.chb.microservice.provider.feign.WxMicroFeignClient;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;

@Service
public class WxMicroHystrixWrapped {

	@Autowired
	private WxMicroFeignClient wxMicroFeignClient;

	@HystrixCommand(groupKey = "helloGroup", fallbackMethod = "fallBackCall")
	public Object findByParatemer(String code) {
		return wxMicroFeignClient.findByParatemer(code);
	};

	@HystrixCommand(groupKey = "helloGroup", fallbackMethod = "fallBackCall")
	public Object openidGet(String type, // 1,安卓；0,IOS
			String openId, String ucode) {
		return wxMicroFeignClient.openidGet(type, openId, ucode);
	}
	
	public Object fallBackCall(String code) {
		return "报错";
	}
	
	public Object fallBackCall(String type, // 1,安卓；0,IOS
			String openId, String ucode) {
		return "报错";
	}

}
